<?php

namespace app\command;
use think\App;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use app\order\logic\OrderLogic;
use app\order\logic\CheckbillLogic;
use app\api\logic\TestLogic;
use app\api\logic\ApiOrderLogic;
use app\order\logic\OrderCostLogic;
class OrderCommand extends Command
{

        protected function configure()
        {
                $this->setName('orderConsummer')
                ->setDescription('orderConsummer');
        }

        protected function execute(Input $input, Output $output)
        {

        // 检核shopify退款状态与支付平台是否同步
        // (new OrderLogic())->CheckbillRefund();die;

        //test3
        // (new OrderLogic())->test3();die;

        //skuinfo添加颜色尺码
        // (new OrderLogic())->order_skuinfo();die;
                
        //订单master标签
        // (new OrderLogic())->LabelVisa();die;

        //删除折扣
        (new OrderLogic())->DeleteDiscount();die;
        //重新邮件订阅
        // (new OrderLogic())->ResendEmailSubscription();die;

        
        //转单号元字段----修改带引号的
        // (new OrderLogic())->ConversionNumber();die;
        //转单号元字段
        // (new OrderLogic())->ConversionNumberElementField();die;
// -----------------------------配送状态
        // (new CheckbillLogic())->DeliveryStatus();die;
        // (new CheckbillLogic())->DeliveryStatus4px();die;
// -----------------------------配送状态
// -----------------------------标签
        // 给mastercard打标签
        // (new OrderLogic())->Labelmastercard();die;
         //给客户打标签--SignFor
        // (new OrderLogic())->LabelCustomersSignFor();die;
        //给客户打标签--hwc
        // (new OrderLogic())->LabelCustomershwc();die;
        //给客户打标签--Whatever
        // (new OrderLogic())->LabelCustomersWhatever();die;
        //邮件改状态--工单合并
        // (new OrderLogic())->conversations_update();die;
// -----------------------------标签

        //订单发货明细
        // (new OrderCostLogic())->OrderShippingDetails();
// -----------------------------FB广告系列
        //拉取广告系列
        // (new OrderCostLogic())->GetAdCampaignsList();
        //拉取广告
        // (new OrderCostLogic())->GetAdCinfoList();die;
// -----------------------------4px平台物流轨迹API

        // -----------------------------4px平台物流轨迹API
        // (new OrderLogic())->Logistics4px();die;
        // $order_number = 'DYY012655394XB';
        //注册718
        // (new ApiOrderLogic())->sync_track_register_718($order_number);die;
        //物流轨迹详情
        // (new ApiOrderLogic())->sync_track_info_718($order_number);die;
        // -----------------------------4px平台物流轨迹API

        //客服部拉取退款订单--查退款金额
        // (new ApiOrderLogic())->export_test2();die; 
        //临时改更新时间order_track
        // (new ApiOrderLogic())->test_order_track();die; 
        //修改skuinfo
        // (new ApiOrderLogic())->order_skuinfo();die;
        //测试配送状态-----4个月数据
        // (new CheckbillLogic())->DeliveryStatus();die;
        //测试配送状态
        // (new ApiOrderLogic())->TestDeliveryStatus();die;
        // 手动更新广告
        // (new OrderLogic())->ManuallyUpdateAdv();die;
        
        // 传spu查半年所有尺码
        // (new OrderLogic())->SpuToCheckAll();die;

        //传sku得到当天销量
        // (new OrderLogic())->SalesDetails();die;
        //根据spu查采购成本--人民币
        // (new OrderLogic())->SpuProcurement();die;

        // 采购入库相差
        // 每日更新多维表格
        // http://erp.backnew.cn/api/ApistockUp/getTablerecordsPants
        //选择忽略的采购 [10093,6200]
        // (new OrderLogic())->DailyQuantity();die;

        //2025-06-09-------------------每个月核对签收情况
                // 智哥对账1
                // (new OrderLogic())->Hualei_Check1();die;
                // 智哥对账2
                // (new OrderLogic())->Hualei_Check2();die;

                // 华磊系统API
                // (new OrderLogic())->Hualei_Check();die;
                // 4px系统API
                // (new OrderLogic())->px_Check();die;
        //2025-06-09-------------------每个月核对签收情况


        // 产品大码--添加上PLUS标签
        // (new OrderLogic())->AddPlusLabel();die;
        // (new OrderLogic())->AddPlusLabels();die;
        // 产品大码--添加上PLUS标签
        // (new OrderLogic())->AddPlusLabel2();die;

        // 客服匹配近六个月订单--邀评数据需求
        // (new OrderLogic())->CustomerOrders();die;
        // 客服匹配近六个月订单----变种2--邀评数据需求
        // (new OrderLogic())->CustomerOrders2();die;

        // kisslovee.myshopify.com 店铺的订单和客户数据信息 备份到 shecurvede.myshopify.com
        // (new OrderLogic())->OrderCustomerBackup();die;

        //今年销量
        // (new OrderLogic())->test1();die;
        // (new OrderLogic())->test2();die;

        //拉取数据--更新争议状态
        //disputeapi---只跑17号店铺---更新状态--前200页
        // (new OrderLogic())->UpdateStatusdisputeapi();die;
        //Afterpay交易新增订单号
        // (new OrderLogic())->Afterpayorder();die;
        //拉取afterpay支付记录
        // (new OrderLogic())->AfterpayPaymentsHistory();die;
        //客服日报
        // (new OrderLogic())->CustomerServiceDaily();die;
// ------------------------------------------3.27需求 查冷总的物流轨迹
        //争议订单和退款订单中已发货的订单筛选出来
        // (new OrderLogic())->CustomersShippedLabel();die;
        // 走冷总物流的非4px和sf开头的 ，查轨迹没有签收的全部筛选出来
        // (new OrderLogic())->CustomersShipped();die;
        // 补充时间等参数
        // (new OrderLogic())->CustomersShipped2();die;
// ------------------------------------------每日更新
        //云汇拉取数据
        // (new OrderLogic())->get_airwallex_list();die;
        //云汇查询交易
        // (new OrderLogic())->airwallex_transactions_info();die;

// ------------------------------------------每日更新
        // product_seller_spu表每天更新spu销量
        // (new OrderLogic())->UpdateSpuSales();
        // product_seller_sku表每天更新sku销量
        // (new OrderLogic())->UpdateSkuSales();die;
// ------------------------------------------每日更新

// ------------------------------------------每周更新
        //测试订单
        // (new OrderLogic())->test_order();
        //交易记录
        // (new OrderLogic())->QueryOrderTransactionApi();
        //客服拉取会话列表
        // (new OrderLogic())->Apireamaze();die;
        // ------------------------------------------每周更新

        //测试交易
        // (new ApiOrderLogic())->TestTransaction();die;
        //shopify创建退款
        // (new OrderLogic())->ShopifyCreatesRefunds();die;
        //临时查交易号
        // (new OrderLogic())->TemporaryCheckTransactionNumber();
// ------------------------------------------物流开始
         //TODO每月执行--财务对账
        // 临时洗数据-----每月物流账单核对重量金额跟总运费
        // (new CheckbillLogic())->MonthlyLogisticsBillVerification();die;
        // (new CheckbillLogic())->MonthlyLogisticsBillVerification2();die;//注册

        //TODO每月执行
        // 临时洗数据-----预估每单物流成本
        // (new OrderLogic())->EstimatedCostPerOrder();die;

// ------------------------------------------标签分配--每月执行
        //临时洗数据-----订单分配标签为空的情况
        // (new OrderLogic())->CompleteOrderSource();die;
        //查找utm---客户行为日志
        // (new OrderLogic())->CustomerBehaviorLog();die;
        //查找utm---匹配
        // (new OrderLogic())->customerj_handle();die;
        //查找utm---恢复匹配
        // (new OrderLogic())->RestoreMatch();die;
// ------------------------------------------标签分配--每月执行
        // 华磊系统API
        // (new OrderLogic())->HualeiSystemApis();die;
        // 4px系统API
        // (new OrderLogic())->pxSystemApis();die;
        // 临时洗数据-----修改配送状态
        // (new OrderLogic())->ModifyDeliveryStatus();die;

        //转单号元子段
        // (new OrderLogic())->ConversionNumberYuanSubSegment();die;
        //整理未发货的客户
        // (new OrderLogic())->UnshippedCustomers();die;
        //给未发货的客户打标签
        // (new OrderLogic())->LabelCustomers();die;
        //给未发货的客户打标签---工单标签
        // (new OrderLogic())->WorkOrderLabel();die;
        //给邮件平台打标签
                        // (new OrderLogic())->LabelTheEmailPlatform();die;
// ------------------------------------------客服查看标签
        //新增daijinquan标签-匹配关键词 vouchers/coupons/gift card/partial refund
                        // (new OrderLogic())->DaijinquanTag();die;
        //新增daijinquan标签-First标签
                        // (new OrderLogic())->FirstTag();die;
        //添加category
        // (new OrderLogic())->AddCategory();die;
        //客服拉取会话列表
        // (new OrderLogic())->Apireamaze();die;
        //修改标签定制
        // (new OrderLogic())->ModifyTagsCustomized();die;
        //修改标签
        // (new OrderLogic())->ModifyTags();die;
        //删除标签
        // (new OrderLogic())->DeleteATap();die;
        //发送消息
        // (new OrderLogic())->SendMessage();die;
        //查看消息
        // (new OrderLogic())->ViewMessage();die;
        //客服查看详情
        // (new OrderLogic())->CustomerServiceViewDetails();die;
        //客服查看标签
        // (new OrderLogic())->CustomerServiceViewTags();die;    
// ------------------------------------------每天执行
        // //Afterpay拉取客户
        //conversations找订单时间
        // (new OrderLogic())->ConversationsFindOrderTime();
        //客服拉取会话列表
        // (new OrderLogic())->Apireamaze();
        // die;

        //1688签名
        // (new TestLogic())->ApiSignatureStringPost();die;
        //添加标签
        // (new OrderLogic())->AddTags_tro04b();die;
        // 拆分sku成个体
        // $SkuIndividual = (new OrderLogic())->SplitSkusIntoIndividuals('black-4XL,bra126-black-40E');
        // halt($SkuIndividual);
        // 统计sku数量
        // $Number = (new OrderLogic())->CountTheNumberOfSkus('bra126-black+blue-40E-2');
        // halt($Number);
        //查询订单的sku件数是否可以发货
        // (new OrderLogic())->CheckTheNumberOfSkus();die;
        //复制产品信息到订单表
        // (new OrderLogic())->CopyProductInformation();die;
        //查询广告数据
        // (new OrderLogic())->QueryAdvertisingData();die;
        //test
        // 历史sku更新到仓库
        // (new OrderLogic())->skuSynthesis();die;
// ------------------------------------------每天执行
        //交易api匹配订单时间
        // 临时洗数据
        // (new OrderLogic())->OrderBalanceApi();die;
        
        //订单来源匹配number
        // 临时洗数据
        // (new OrderLogic())->OrderSourceMatchingNumber();die;
        
        //TODO每月执行---同步订单时间
        // (new OrderLogic())->SynchronizeOrderTime();die;
        
        //临时洗数据-----反馈表新增SPU
        // (new OrderLogic())->AddSpuToFeedbackForm();die;

        //新增订单搜索字段
        // 临时洗数据-----新增订单搜索字段
        // (new OrderLogic())->AddOrderSearchField();die;

// ------------------------------------------标签分配--每月执行

        //新独立站-shopify客户来源匹配标签
        // 临时洗数据
        // (new OrderLogic())->customerj_handle();die;

        //临时洗数据-----检查遗漏---sku遗漏
        // (new OrderLogic())->CheckForMissedOrders();die;

        //临时洗数据-----恢复日志
        // (new OrderLogic())->RestoreLogs();die;
        
// ------------------------------------------财务管理模块--每月执行
        // shopline店铺重新获取

        // 临时洗数据-----更新退款订单
        // (new OrderLogic())->UpdateRefundOrder();die;

        //订单匹配到争议
        // 临时洗数据-----业绩表spu为空
        // (new OrderLogic())->AddOrderSearchField();die;

        //临时洗数据-----检查遗漏---sku遗漏
        // (new OrderLogic())->CheckForMissedOrders();die;

        //TODO每月执行
        // 临时洗数据-----财务业绩数据核对
        // (new OrderLogic())->FinancialStatementVerification();die;

// ------------------------------------------争议成本
        //2025最新--分别更新云汇争议状态 改成1000一页
        // (new OrderLogic())->get_airwallex_list();die;

        //TODO每月执行
        // 更新争议状态跟金额
                // (new OrderLogic())->UpdateDisputeStatusAndAmount();die;

        //TODO每月执行
        //手动更新争议状态跟金额
        // (new OrderLogic())->ManuallyUpdateDisputeStatusAndAmount();die;

        //TODO每月执行
        //争议数据统计成每个月的报表
        // (new OrderLogic())->DisputeToMonthlyReports();die;
        
// ------------------------------------------争议结束

// ------------------------------------------广告成本
        //TODO每天执行
        // 临时洗数据-----广告账户分配到店铺
        // (new OrderLogic())->DailyStatisticsOfAdv_admin();die;

        //TODO每天执行
        // 临时洗数据-----每天统计广告运营消耗
        // (new OrderLogic())->DailyStatisticsOfAdv();die;



// ------------------------------------------采购开始

        // TODO每月执行
        // 临时洗数据-----发消息通知
        // (new OrderLogic())->SendAMessageNotification();die;

        // TODO每月执行
        // 临时洗数据-----每月采购成本SPU
        // (new OrderLogic())->MonthlySpuCost();

        // TODO每月执行
        // 临时洗数据-----补全SKU
        // (new OrderLogic())->MonthlySkuCost();die;

        // TODO每月执行-----等财务发一版纠正后的数据
        // 临时洗数据-----SPU纠正成最新的
        // (new OrderLogic())->SpuCorrectedToTheLatestVersion();die;

        // TODO每月执行
        // 临时洗数据-----SKU价格同步
        // (new OrderLogic())->CompleteTheProcurementCost();die;

        // TODO每月执行
        // 临时洗数据-----部分SPU的sku采购价不同---重新按sku的采购价更新
        // (new OrderLogic())->PartialSpuSkusHaveDifferentEdit();die;

        //TODO每月执行
        // 临时洗数据-----预估每单采购成本
        // (new OrderLogic())->EstimatedCostPerOrderPurchase();die;

// ------------------------------------------采购结束

        //TODO每月执行---order_historical
        // (new OrderLogic())->order_historical();
        // (new OrderLogic())->order_historical2();
        // (new OrderLogic())->order_historical3();
        // (new OrderLogic())->order_historical_woob();
        // (new OrderLogic())->order_historical2_woob();
        // (new OrderLogic())->order_historical3_woob();die;
        // (new OrderLogic())->order_historical_test();die;
        // (new OrderLogic())->order_historical_test2();die;

        //TODO每月执行---检查skuquantity
        // (new OrderLogic())->ModifySkuQuantity();die;

        //TODO每月执行
        // 临时洗数据-----小店铺订单标记到个人
        // (new OrderLogic())->TagSmallStoreOrdersToIndividuals();die;

        //TODO每月执行
        // 新方案-----每月统计业绩--大店铺订单标记到个人
        // (new OrderLogic())->MonthlyPerformanceStatistics();die;

        //test
        // 临时洗数据--12月孙义翔
        // (new OrderLogic())->test();die;

        //TODO每月执行
        // 临时洗数据-----每月统计店铺业绩
        // (new OrderLogic())->MonthlyStatisticsOfStore();die;

        //TODO每月执行
        // 0临时洗数据-----每月统计运营业绩
        (new OrderLogic())->MonthlyStatisticsOfpersonal();die;

        //TODO每月执行
        // 0临时洗数据-----每月统计运营业绩--只计算提成部分
        // (new OrderLogic())->MonthlyStatisticsOfpersonalCommission();die;

        //TODO每月执行
        // 1临时洗数据-----整理每月广告
        // (new OrderLogic())->OrganizeMonthlyAdvertisements();die;

        //TODO每月执行
        // 2临时洗数据-----渠道内分配比例---分配完成之后访问MonthlyStatisticsOfpersonal更新数据
        // (new OrderLogic())->advertising_rate();die;

        //TODO每月执行
        // 3临时洗数据-----每月统计运营业绩
        // (new OrderLogic())->MonthlyStatisticsOfpersonal();die;
        //TODO每月执行
        // 临时洗数据-----渠道内分配
        // (new OrderLogic())->WithinTheChannel();die;

        // 临时洗数据-----渠道外分配
        // (new OrderLogic())->DistributionOutsideTheChannel();

        // 临时洗数据-----小店未分配
        // (new OrderLogic())->SmallShopNotAllocated();die;

// ------------------------------------------财务管理模块结束

        //临时洗数据-----匹配发货的sku是否有库存
        // (new OrderLogic())->DoesSkuHaveInventory();

        }
}